package day03_ThreadPool.demo_network_Socket.UDP_demo;

import java.net.DatagramPacket;
import java.net.DatagramSocket;

public class Buyer {
    public static void main(String[] args) throws Exception{
        DatagramSocket datagramSocket= new DatagramSocket(10004);
        byte[] buf= new byte[64];
        DatagramPacket datagramPacket=new DatagramPacket(buf,buf.length);

        datagramSocket.receive(datagramPacket);
        String s= new String(buf);
        System.out.println("接受的包裹数据时："+s);
    }
}
